package com.example.demo.candycrush;

import com.example.demo.candycrush.strategy.CrushStrategy;
import com.example.demo.candycrush.strategy.RemoveStrategy;
import com.example.demo.candycrush.strategy.ReplaceStrategy;

import java.util.List;

public class CandyCrush {
    public static void main(String[] args) {
        if (args.length < 2) {
            System.out.println("Usage: <mode> <input>");
            System.out.println("Modes: 1 - Remove, 2 - Replace");
            return;
        }
        
        int mode = Integer.parseInt(args[0]);
        String input = args[1];
        
        CrushStrategy strategy = (mode == 1) ? new RemoveStrategy() : new ReplaceStrategy();
        CandyCrushProcessor processor = new CandyCrushProcessor(strategy);
        
        List<String> results = processor.process(input);
        results.forEach(System.out::println);
    }
}